package com.ibeeking.found.common.enums;

public enum BulletinTypeEnum {
    BULLETIN_UPDATE("系统更新", 1),
    BULLETIN_SYSTEM("系统公告", 2),
    BULLETIN_MARKETTING("活动公告", 3);

    private String name;
    private Integer type;

    BulletinTypeEnum(String name, Integer type) {
        this.name = name;
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public Integer getType() {
        return type;
    }

    public static String getNameByType(Integer type) {
        for (BulletinTypeEnum enumObj : values()) {
            if (enumObj.getType().equals(type)) {
                return enumObj.getName();
            }
        }
        return null;
    }

    public static BulletinTypeEnum getEnumByType(Integer type) {
        for (BulletinTypeEnum enumObj : values()) {
            if (enumObj.getType().equals(type)) {
                return enumObj;
            }
        }
        return null;
    }
}
